** Replication code for "War Makes the Regime: Regional Rebellions and Regime Militarization Worldwide", by Ferdinand Eibl, Dan Slater & Steffen Hertog, in British Journal of Political Science
** Prepared on 8 August 2019

* Load 'Eibl, Slater, Hertog replication data.dta'

** Main body
* Table 1
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Figure 1
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
margins, at(lregional_decay=(1 0.5 0.25 0.125 0.0625 0.03125)) asobserved 
marginsplot, recastci(rarea) ci1opts(fintensity(20)) xscale(reverse) xlabel(1 "t" 0.5 "t+1" 0.25 "t+2" 0.125 "t+3" 0.0625 "t+4" 0.03125 "t+5") xtitle("Regional rebellion (decay)") ytitle("Probability of miliary regime emergence") title("")

* Table 2
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2 if svolik_military==1, cluster(cowcode) 

* Figure 2
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
margins, at(ldurregion=(1(1)25)) asobserved 
marginsplot, plot1opts(msymbol(Oh)) plot2opts(msymbol(X)) plot3opts(msymbol(O)) xtitle("Duration of regional conflict") legend(order(4 "non-military" 5 "indirect military" 6 "direct military")) ytitle("Probability of regime type") legend(label(4 "non-military" 5 "indirect military" 6 "direct military")) title("") 

* Figure 3
mlogit svolik_milord ldurregion ldurideo lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap lrelfrac c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2 if svolik_military==1, cluster(cowcode) 
margins, at(ldurregion=(1(1)25)) asobserved 
marginsplot, plot1opts(msymbol(Oh)) plot2opts(msymbol(X)) xtitle("Duration of regional conflict") legend(order(3 "indirect military" 4 "direct military")) ytitle("Probability of regime type") legend(label(3 "non-military" 4 "indirect military" 3 "direct military")) title("") 

** Online Appendix
* Table A1
summarize svolik_military svolik_milord svolik_democratictrans regional_decay ideological_decay regional ideological regional_cumdummy ideological_cumdummy regional_origin11n ideological_origin11n durregion durideo ///,
ln_gdp ln_pop polity2 ln_miltcap ln_unrest external ethfrac3 ln_rents popdensity_UNDP open postcold if year>=1945

* Table A2
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
tab country if e(sample)

* Figure A1
* Load 'Descriptive stats.dta'
graph hbar mean_decay direct_trans trans, over(type) ytitle("Percent") legend(position(6) size(medsmall) label(2 "Directly following regional rebellion") label(3 "Previously experienced regional rebellion") label(1 "Mean of Regional rebellion (decay)"))

* Figure A2
* Load 'Descriptive stats 2.dta'
label define rebeltype 1 "previously experienced regional rebellion" 2 "directly following regional rebellion" 3 "experienced regional rebellion during spell", replace  
label values variable rebeltype

graph hbar value, over(type) over(variable, relabel(1 `" "previously experienced" "regional rebellion" "' 2 `" "directly following" "regional rebellion" "' ///,
3 `" "experienced regional" "rebellion during spell"" "' )) ytitle("Average regime duration in years")  asyvars bar(1, color(gs8)) bar(2, color(gs4))

* Figure A3
* Load 'Descriptive stats 3.dta'
label define miltype 1 "democracy or civilian autocracy" 2 "indirect military rule" 3 "direct military rule", replace  
label values miltype miltype

graph hbar dur, over(miltype) ytitle("Average years of experienced regional rebellion") legend(position(6) size(medsmall) label(2 "indirect military rule") label(3 "direct military rule") label(1 "democracy or civilian autocracy"))

* Load 'Eibl, Slater, Hertog replication data.dta'
* Table A4 
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Figure A4
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
margins, at(lregional_decay=(1 0.5 0.25 0.125 0.0625 0.03125)) asobserved 
marginsplot, recastci(rarea) ci1opts(fintensity(20)) xscale(reverse) scheme(s2mono) xlabel(1 "t" 0.5 "t+1" 0.25 "t+2" 0.125 "t+3" 0.0625 "t+4") xtitle("Regional rebellion (decay)") ytitle("Probability of democratization") title("")

* Table A5
logit svolik_military  ///,
regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean lln_gdp_w ln_pop_gmean lln_pop_w polity2_gmean lpolity2_w ln_miltcap_gmean lln_miltcap_w ///,
ln_unrest_gmean lln_unrest_w external_gmean lexternal_w relfrac_gmean lrelfrac_w prefail_svolik_gmean lprefail_svolik_w  ///, 
i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military svolik_military_gmean ///,
regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary prefail_svolik_gmean lprefail_svolik_w if lsvolik_military!=1, cluster(cowcode)  

* Figure A5
logit svolik_military svolik_military_gmean ///,
regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary prefail_svolik_gmean lprefail_svolik_w if lsvolik_military!=1, cluster(cowcode)

margins, at(lregional_decay_w=(-0.25(0.01)0.25)) asobserved 
marginsplot, recastci(rarea) ci1opts(fintensity(20)) xscale(range(-0.25 0.25)) xtitle("Deviations from country means") ytitle("Probability of miliary regime") title("")

* Table A6
logit svolik_democratictrans svolik_democratictrans_gmean ///,
regional_cumdummy_gmean ideological_cumdummy_gmean ln_gdp_gmean lln_gdp_w ln_pop_gmean lln_pop_w polity2_gmean lpolity2_w ln_miltcap_gmean lln_miltcap_w ///,
ln_unrest_gmean lln_unrest_w external_gmean lexternal_w relfrac_gmean lrelfrac_w prefail_svolik_gmean lprefail_svolik_w prefail_svolikfail_gmean lprefail_svolikfail_w  ///,
i.region3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure if lsvolik_military==1, cluster(cowcode) 
logit svolik_democratictrans svolik_democratictrans_gmean  ///,
regional_origin11n_gmean ideological_origin11n_gmean ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure prefail_svolikfail_gmean lprefail_svolikfail_w if lsvolik_military==1, cluster(cowcode) 
logit svolik_democratictrans svolik_democratictrans_gmean ///,
regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure prefail_svolikfail_gmean lprefail_svolikfail_w if lsvolik_military==1, cluster(cowcode) 
logit svolik_democratictrans svolik_democratictrans_gmean  ///,
regional_cumdummy_gmean ideological_cumdummy_gmean regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure prefail_svolikfail_gmean lprefail_svolikfail_w if lsvolik_military==1, cluster(cowcode) 
logit svolik_democratictrans svolik_democratictrans_gmean ///,
regional_origin11n_gmean ideological_origin11n_gmean regional_decay_gmean lregional_decay_w ideological_decay_gmean lideological_decay_w ln_gdp_gmean ln_pop_gmean polity2_gmean ln_miltcap_gmean ln_unrest_gmean external_gmean relfrac_gmean ///, 
lln_gdp_w lln_pop_w lpolity2_w lln_miltcap_w lln_unrest_w lexternal_w lrelfrac_w ///, 
i.region3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure prefail_svolikfail_gmean lprefail_svolikfail_w if lsvolik_military==1, cluster(cowcode) 

* Table A7
logit svolik_military lregional lideological lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional lideological lln_gdp lln_pop lpolity2 lexternal i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional lideological lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional lideological lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional lideological lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A8 
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional lideological lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional lideological lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional lideological lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional lideological lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Table A9
logit coup_PT_dummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.nocoup_PT##c.nocoup_PT##c.nocoup_PT l.prefail_coupPT, cluster(cowcode) // p=0.14
logit coup_MS_dummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.nocoup_MS##c.nocoup_MS##c.nocoup_MS l.prefail_coupMS, cluster(cowcode) // p=0.05

* Table a10
logit svolik_military lregional_cdwtd_mean lideological_cdwtd_mean lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)

* Figure A6
logit svolik_military lregional_cdwtd_mean lideological_cdwtd_mean lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
margins, at(lregional_cdwtd_mean=(1(100)6400)) asobserved 
marginsplot, xtitle("Distance of regional rebellion to capital (km)") ytitle("Probability of military regime emergence") title("")

* Table A11
ivreg2 svolik_military (lregional_decay lideological_decay=lbdeadlowCONT ln_inst3) lln_gdp lpolity2 lexternal lln_miltcap lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail2_svolik if lsvolik_military==0, savefirst first liml partial(i.region3) cluster(cowcode) 
ivreg2 svolik_democratictrans (lregional_decay lideological_decay=lbdeadlowCONT ln_inst3) lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, savefirst first liml partial(i.region3) cluster(cowcode) 

* Table A12
logit svolik_military lregional_decay lideological_decay lln_rents lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_rents lpopdensity_UNDP lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold i.lregime2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold i.lregime2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lethfrac3 lln_miltcap c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A13
mlogit svolik_milord ldurregion ldurideo lethfrac3 lln_rents lpopdensity_UNDP lopen postcold i.lregime2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lethfrac3 lln_rents lpopdensity_UNDP lopen postcold i.lregime2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2 if svolik_military==1, cluster(cowcode) 

* Table A14
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_rents lpopdensity_UNDP lopen postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay lideological_decay lln_rents lpopdensity_UNDP  postcold lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Table A15
logit svolik_military lregional_decay lideological_decay lsvolmilitaryshare lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lsvolmilitaryshare lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A16
mlogit svolik_milord ldurregion ldurideo lsvolmilitaryshare lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lsvolmilitaryshare lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 lprefail_svolik2 if svolik_military==1, cluster(cowcode) 

* Table A17
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy  lsvoldemocracyshare  lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n  lsvoldemocracyshare  lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay lideological_decay lsvoldemocracyshare  lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lsvoldemocracyshare  lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lsvoldemocracyshare  lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay lideological_decay lsvoldemocracyshare lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Table A18
drop svolik_nomilitary prefail_svolik _spline*
btscs svolik_military year cowcode, gen(svolik_nomilitary) f nspline(3)
rename _prefail prefail_svolik
drop _frstfl _tuntilf 
replace svolik_nomilitary=svolik_nomilitary+1

logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 _spline* lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac _spline* lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 ln_svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac ln_svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary i.decade lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary i.decade lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A19
drop svolik_nomilitary2 prefail_svolik2 _spline*
btscs svolik_milord year cowcode, gen(svolik_nomilitary2) f nspline(3)
rename _prefail prefail_svolik2
drop _frstfl _tuntilf 
replace svolik_nomilitary2=svolik_nomilitary2+1

mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap _spline* lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap ln_svolik_nomilitary2 lprefail_svolik2, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 i.decade lprefail_svolik2, cluster(cowcode) 

mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap _spline* lprefail_svolik2 if svolik_military==1, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap ln_svolik_nomilitary2 lprefail_svolik2 if svolik_military==1, cluster(cowcode) 
mlogit svolik_milord ldurregion ldurideo lrelfrac lln_gdp lln_pop lpolity2 lexternal lln_unrest lln_miltcap c.svolik_nomilitary2##c.svolik_nomilitary2##c.svolik_nomilitary2 i.decade lprefail_svolik2 if svolik_military==1, cluster(cowcode) 

* Table A20
drop svolikregime_failure svolik_noregimefailure prefail_svolikregimefailures _spline*  
sort cowcode year
gen svolikregime_failure=0 if (l.svolik_democracy==1 & svolik_democracy==1)|(l.svolik_civilian==1 & svolik_civilian==1)|(l.svolik_military==1 & svolik_military==1)
replace svolikregime_failure=1 if (l.svolik_democracy==1 & svolik_democracy==0)|(l.svolik_civilian==1 & svolik_civilian==0)|(l.svolik_military==1 & svolik_military==0)
btscs svolikregime_failure year cowcode, gen(svolik_noregimefailure) f  nspline(3)
rename _prefail prefail_svolikregimefailures
drop _tuntilf _frstfl
gen ln_svolik_noregimefailure=log(1+svolik_noregimefailure)

logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3 _spline* lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  _spline* lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac _spline* lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3 ln_svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  ln_svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac ln_svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3 i.decade c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) 
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3 i.decade c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) 
clogit svolik_democratictrans lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  i.decade lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode)

* Table A21
logit gwf_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 i.region3 c.nomilitary##c.nomilitary##c.nomilitary prefail if lgwf_military!=1, cluster(cowcode) 
logit gwf_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal i.region3 c.nomilitary##c.nomilitary##c.nomilitary prefail if lgwf_military!=1, cluster(cowcode) 
logit gwf_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.nomilitary##c.nomilitary##c.nomilitary prefail if lgwf_military!=1, cluster(cowcode)
logit gwf_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.nomilitary##c.nomilitary##c.nomilitary prefail if lgwf_military!=1, cluster(cowcode)
clogit gwf_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.nomilitary##c.nomilitary##c.nomilitary prefail if lgwf_military!=1, cluster(cowcode) group(cowcode) 

* Table A22
logit gwf_democratictrans2 lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode)
logit gwf_democratictrans2 lregional_origin11gwfn lideological_origin11gwfn lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode)
logit gwf_democratictrans2 lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode)
logit gwf_democratictrans2 lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode)
logit gwf_democratictrans2 lregional_origin11gwfn lideological_origin11gwfn lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode)
clogit gwf_democratictrans2 lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.gwf_duration##c.gwf_duration##c.gwf_duration lprefail_gwf_fail if gwf_military==1, cluster(cowcode) group(cowcode) 

* Table A23
logit svolik_military lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lexternal i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A24
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay2 lideological_decay2 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Table A25
logit svolik_military lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lexternal i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A26
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay3 lideological_decay3 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Table A27
logit svolik_military lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lexternal i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) 
logit svolik_military lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
logit svolik_military lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
clogit svolik_military lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lethfrac3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode) group(cowcode) 

* Table A28
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
logit svolik_democratictrans lregional_origin11n lideological_origin11n lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
clogit svolik_democratictrans lregional_decay5 lideological_decay5 lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode) group(cowcode) 

* Figure A7
tostring year, gen(year2)
gen cowcodeyear=cowcode2+year2
gen id=_n

logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1, cluster(cowcode)
predict dbeta, dbeta
scatter dbeta id, mlab(cowcodeyear)
// 770, 800
drop dbeta

* Figure A8
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1, cluster(cowcode)
predict dbeta, dbeta
scatter dbeta id, mlab(cowcodeyear)
// 160, 350
drop dbeta

* Table A29
logit svolik_military lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lexternal lln_unrest lrelfrac lln_miltcap i.region3 c.svolik_nomilitary##c.svolik_nomilitary##c.svolik_nomilitary lprefail_svolik if lsvolik_military!=1 & cowcode!=800 & cowcode!=770, cluster(cowcode)

* Table A30
logit svolik_democratictrans lregional_cumdummy lideological_cumdummy lregional_decay lideological_decay lln_gdp lln_pop lpolity2 lln_miltcap lln_unrest lexternal lrelfrac i.region3  c.svolik_noregimefailure##c.svolik_noregimefailure##c.svolik_noregimefailure lprefail_svolikregimefailures if lsvolik_military==1 & cowcode!=160 & cowcode!=350, cluster(cowcode)